#!/bin/bash

# zookeeper集群启动脚本

echo "Usage: $0 start|stop|status (zookeeper)"
case $1 in
"start"){
    for i in niit01 niit02 niit03
    do
        echo ---------- zookeeper $i 启动 ------------
        ssh $i "/opt/onlineedu/zookeeper/bin/zkServer.sh start"
    done
};;
"stop"){
for i in niit01 niit02 niit03
    do
        echo ---------- zookeeper $i 停止 ------------
        ssh $i "/opt/onlineedu/zookeeper/bin/zkServer.sh stop"
    done
};;
"status"){
    for i in niit01 niit02 niit03
    do
        echo ---------- zookeeper $i 状态 ------------
        ssh $i "/opt/onlineedu/zookeeper/bin/zkServer.sh status"
    done
};;
esac
